package com.xxx.client.android.util;

import java.util.WeakHashMap;

import android.graphics.Bitmap;

/**
 * Caches downloaded images, saves bandwidth and user's packets
 * 
 */
public class ImageCache extends WeakHashMap<String, Bitmap> {

	public boolean isCached(String url) {
		return containsKey(url) && get(url) != null;
	}

	public void clearImageCache() {
		clear();
	}

	public void putImageCache(String imageUrl, Bitmap bmp) {
		put(imageUrl, bmp);
	}

}
